home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 26 / Cream of the Crop 26.iso / utility / dirco707.zip / DIRCOMP.DOC < prev    next >
Text File  |  1997-07-31  |  18KB  |  378 lines

  1. DIRCOMP.DOC                            1                           Jul 31, 1997
  2.  
  3. WIN95 AND WINNT NOTICE:  As with most DOS-based utilities, this program doesn't
  4. understand the weird subdirectories, long filenames,  invalid  characters  that
  5. are possible under Windows 95 and Windows/NT.   Both  operating  systems  alias
  6. long filenames into names like MYFILE~1.TXT so that's what you're going to  see
  7. processed.  Under some file structure systems in NT, the program may  not  work
  8. at all.
  9.  
  10. DIRCOMP compares subdirectories and looks  for  dissimilarities  between  files
  11. (different sizes or creation dates as well as missing files).  You can have the
  12. command copy files from the first subdirectory to the output subdirectory.   In
  13. some ways, this is similar to the XCOPY and  REPLACE  commands  in  DOS  except
  14. there are a number  of  enhancements  which  make  DIRCOMP  ideal  for  network
  15. maintenance work.  These features include:
  16.  
  17.   * You can specify that the command copy only unmatched files (something  that
  18.     can't be done using XCOPY).
  19.   * You can specify that the  command  process  child  subdirectories  as  well
  20.     (something that can't be done using REPLACE).
  21.   * You can delete the files which are in the destination subdirectory but  not
  22.     in the source subdirectory.
  23.   * You can specify up to 10 file exclusion or inclusion specifications.
  24.   * DIRCOMP produces a disk report called (by default)  C:\DIRCOMP.TXT  showing
  25.     the dissimilarities.
  26.   * DIRCOMP can move the files instead of copy them, effectively  allowing  you
  27.     to prune and graft directory structures.
  28.   * The date format shown is based on your country setting.
  29.   * Pressing escape stops the program early.
  30.  
  31. DIRCOMP is typically used in the process of backing up files from one drive  to
  32. another.  DIRCOMP allows you to easily copy every  file  and  get  rid  of  now
  33. non-existant files.
  34.  
  35. Most people who report using DIRCOMP say  they  use  the  program  to  maintain
  36. workstations in a networked environment.  They take the files  from  a  network
  37. directory and use them to replace the files on the workstation.
  38.  
  39. Note that DOS includes a command called REPLACE which will do some of the  same
  40. things that this utility does.  The central differences are that REPLACE  won't
  41. delete mismatched files and it doesn't produce  a  report  on  inconsistencies.
  42. REPLACE also doesn't have the ability to handle odd  attributes  or  deal  with
  43. cascading subdirectories.  REPLACE *is* a lot quicker though.
  44.  
  45.  
  46. DIRCOMP.DOC                            2                           Jul 31, 1997
  47.  
  48. The report:
  49.  
  50. If you have the report option turned on (/F or  /Frptfile),  the  program  will
  51. produce a text file comparing the  two  file  specifications  and  showing  you
  52. differences and such.  And example of a report:
  53.  
  54. DIRCOMP begun: 11-27-96 at 14:05:21
  55. Parms: \TEMP \TEMP2 /S /FC:\X3.X /OVERWRITE /CLONE /KILL /ALL
  56.  
  57. Directory 1: C:\TEMP\ /S
  58. Directory 2: C:\TEMP2\ /S
  59.  
  60.                                          +-- √ = copied, x = killed
  61. FileName     Directory 1.................| Directory 2................. Verdict
  62.  
  63. AUTO.1       11-06-96 14:55:42      1,340√                              Miss(2)
  64. AUTOEXEC.1   11-06-96 14:55:42      1,340√                              Miss(2)
  65. CONFIG.1     08-19-96 14:57:50        725√                              Miss(2)
  66. PHONMAIL.OUT 11-27-96 03:38:22      3,768√ 11-27-96 03:38:22      3,768   ok
  67. TEST0.BAT    11-27-96 13:53:16        153√ 11-27-96 13:53:16        153   ok
  68. TEST1.BAT    11-27-96 13:48:44         89√ 11-27-96 13:48:44         89   ok
  69. TEST2.BAT    11-27-96 13:48:44         81√ 11-27-96 13:48:44         81   ok
  70. TEST3.BAT    11-27-96 14:05:16         81√ 11-27-96 14:04:48         88 Newer(1
  71. X.1          11-27-96 13:45:38      2,242                               AttSkip
  72. X1.X         11-27-96 14:01:56      2,346                               AttSkip
  73. X2.X                                     x 11-27-96 14:02:00      2,374 Miss(1)
  74. X3.X                                     x 11-27-96 14:04:52      2,462 Miss(1)
  75.  
  76.   1\
  77. AUTOEXEC.BAT 11-06-96 14:55:42      1,340√ 11-06-96 14:55:42      1,340   ok
  78. HIDDEN.TXT   11-06-96 14:55:42      1,340  11-06-96 14:55:42      1,340 AttSkip
  79. READONLY.TXT 11-06-96 14:55:42      1,340  11-06-96 14:55:42      1,340 AttSkip
  80. SYSTEM.TXT   11-06-96 14:55:42      1,340  11-06-96 14:55:42      1,340 AttSkip
  81.  
  82.   2\
  83. AUTOEXEC.BAT 11-06-96 14:55:42      1,340√ 11-06-96 14:55:42      1,340   ok
  84.  
  85.      15           Dir 1: Total files in C:\TEMP\ /S
  86.               12  Dir 2: Total files in C:\TEMP2\ /S
  87.       1        1  Newer in dir 1 (Copied)
  88.       0        0  Newer in dir 2 (Copied)
  89.       0        0  File sizes differ (Copied)
  90.       6        6  Identical date/time/size (Copied)
  91.       0        2  Not in dir 1 at all (Deleted)
  92.       3        0  Not in dir 2 at all (Copied)
  93.       5        3  Having excluded attr spec
  94.      10  files copied (10,257 bytes)
  95.       2  files killed (4,836 bytes)
  96.  
  97. DIRCOMP ended: 11-27-96 at 14:05:24
  98.  
  99. Note there is a column with "√" (square root symbols) that indicates  the  file
  100. was copied/moved or an "x" to indicate the file was deleted.
  101.  
  102.  
  103. DIRCOMP.DOC                            3                           Jul 31, 1997
  104.  
  105. When are files copied or moved:
  106.  
  107. DIRCOMP has five action parameters that are mutually exclusive which determines
  108. which (if any) files get copied or moved:
  109.  
  110.  /NONE   says to skip everything and just report on the differences.
  111.  
  112.  /DIFF   says to copy any files which are different in size, creation date,  or
  113.          time as well as any files which don't already exist in the destination
  114.          subdirectory at all.
  115.  
  116.  /A      says to only copy files to the destination subdirectory only  if  they
  117.          are not currently there.
  118.  
  119.  /U      says to only copy files to the destination subdirectory  if  they  are
  120.          newer in the source subdirectory.
  121.  
  122.  /AU     says to  copy  files  if  they  are  either  not  in  the  destination
  123.          subdirectory or they're more recent in the source subdirectory.
  124.  
  125.  /CLONE  says to copy everything no matter what.
  126.  
  127. The following table may help explain this:
  128.  
  129. File in         File in                               Copy?
  130. Source sub      Destination sub       /NONE /DIFF  /A    /U    /AU  /CLONE
  131.  
  132. Newer           Older                 no    YES    no    YES   YES  YES
  133. Older           Newer                 no    YES    no    no    no   YES
  134. One size        Another size          no    YES    no    no    no   YES
  135. Present         Missing               no    YES    YES   no    YES  YES
  136. Same            Same                  no    no     no    no    no   YES
  137.  
  138. Missing         Present               (delete if /KILL set)
  139.  
  140.  
  141. Specifying parameters:
  142.  
  143. Parameters for this program can be set in the following ways.  The last setting
  144. encountered always wins:
  145.   - Read from an *.INI file (see BRUCEINI.DOC file),
  146.   - Through the use of an environmental variable (SET DIRCOMP=whatever), or
  147.   - From the command line (see "Syntax" below)
  148.  
  149.  
  150.  
  151. DIRCOMP.DOC                            4                           Jul 31, 1997
  152.  
  153. Syntax:
  154.  
  155.     DIRCOMP directory1 directory2 [ /S ] [ /CREATE ]
  156.       [ /NONE | /DIFF | /A | /U | /AU | /CLONE ] [ /KILL ] [ /MOVE ]
  157.       [ /Xfilespec ]... [ /Nfilespec ]... [ /ATTR=attribs ]
  158.       [ /F | /Frptfile | /-F ]
  159.       [ /OVERWRITE | /APPEND | /-OVERWRITE | /OVERASK ] [ /ALL ] [ /Tpath ]
  160.       [ /Q ] [ /COLOR=nnn | /MONO ] [ /Iinitfile | /-I ] [ /-ENV ] [ /? ]
  161.  
  162. where:
  163.  
  164. "directory1" is the name of the primary (source) subdirectory.  If /NONE is not
  165. in effect, the secondary subdirectory's contents will be changed to reflect the
  166. ones here.
  167.  
  168. "directory2" is the name of the secondary subdirectory which  will  have  files
  169. copied to it or deleted from it.
  170.  
  171. "/S" goes through and processes subdirectories off of  the  subdirectories  you
  172. specified in a cascading manner.  You  can  use  this  option  to  copy  entire
  173. directory trees if you want.  Still requires a setting other than /NONE  to  be
  174. in effect if you want it to actually do anything besides report  on  conditions
  175. of course.  "/-S" (the opposite) is initially the default.
  176.  
  177. "/CREATE" will create directory2 if it doesn't exist  already.   Of  course  it
  178. will not create subdirectories more than one level deep (if you  don't  have  a
  179. C:\TEST yet, don't bother specifying that you want it  to  create  C:\TEST\CASE
  180. for you).  "/-CREATE" (the opposite) is initially the default.
  181.  
  182. "/NONE" specifies that no actual copying or moving of files is to  take  place.
  183. This is initially the default.   The  following  parameters  are  all  mutually
  184. exclusive:  /NONE, /DIFF, /A, /U, /AU, and /CLONE.
  185.  
  186. "/DIFF" says to copy files from the  source  subdirectory  to  the  destination
  187. subdirectory if it either doesn't exist in the destination subdirectory or  its
  188. file date, time, or size  is  different.   The  following  parameters  are  all
  189. mutually exclusive:  /NONE, /DIFF, /A, /U, /AU, and /CLONE.
  190.  
  191. "/A" adds new files only to the destination subdirectory.  If the  file  exists
  192. already in the destination subdirectory, it will be skipped over  whether  it's
  193. newer or not.  The following parameters are  all  mutually  exclusive:   /NONE,
  194. /DIFF, /A, /U, /AU, and /CLONE.
  195.  
  196. "/U" says to  copy  files  only  if  they  exist  already  in  the  destination
  197. subdirectory and only if the files in the destination  subdirectory  are  older
  198. than the ones in the source subdirectory.  The  following  parameters  are  all
  199. mutually exclusive:  /NONE, /DIFF, /A, /U, /AU, and /CLONE.
  200.  
  201. "/AU" copies the file if the version in the destination subdirectory is  either
  202. missing or older than the one in the source subdirectory.  Note that  "/UA"  is
  203. treated  the  same  as  "/AU".   The  following  parameters  are  all  mutually
  204. exclusive:  /NONE, /DIFF, /A, /U, /AU, and /CLONE.
  205.  
  206.  
  207. DIRCOMP.DOC                            5                           Jul 31, 1997
  208.  
  209. "/CLONE" says to copy all files from directory1 to  directory2.   Period.   The
  210. following parameters are all mutually exclusive:  /NONE, /DIFF,  /A,  /U,  /AU,
  211. and /CLONE.
  212.  
  213. "/KILL" says to delete any files in directory2 which are not in directory1.  It
  214. will also delete any empty subdirectories  in  directory2  (whether  they  were
  215. empty off directory1 or not).  The program may not be smart  enough  to  delete
  216. all embedded subdirectories.  /KILL is ignored if /NONE  is  still  in  effect.
  217. "/-KILL" (the opposite) is initially the default.
  218.  
  219. "/MOVE" says to move the files instead of  copying  them.   This  deletes  from
  220. directory1 any file that was copied to directory2.  (The deletion is done  only
  221. if the initial copy succeeded.) Typically, the option is  used  in  combination
  222. with the /CLONE option.  "/-MOVE" (the opposite) is initially the default.
  223.  
  224. "/Xfilespec" says to exclude certain filespecs from being considered.  You  can
  225. specify up to 10 exclusion parameters but each must have their  own  /Xfilespec
  226. statement.  For example, to exclude all files with a CFG extension,  you  could
  227. say "DIRCOMP (other parms) /X*.CFG".  Note that exclusions and inclusions apply
  228. to subdirectory names too if /S is used; /XCLONE23 will exclude processing  any
  229. files in the CLONE23 subdirectory.
  230.  
  231. "/Nfilespec" says to include certain filespecs.   You  can  specify  up  to  10
  232. inclusion parameters but each must have their own /Nfilespec statement.   Files
  233. have to meet this filespec filter in order to be considered.  For  example,  to
  234. only update EXE and COM files, you could say  "DIRCOMP  (other  parms)  /I*.EXE
  235. /I*.COM".
  236.  
  237. "/ATTR=attribs" allows you to specify a combination of attributes that you want
  238. considered.  You can specify any combination of R (read-only),  H  (hidden),  S
  239. (system), or A (archive bit).  Precede any character(s)  with  "-"  to  exclude
  240. instead of include.  Unlike with  the  DOS  DIR  command,  the  inclusions  and
  241. exclusions are subject to "OR" conditions; /ATTR=HS will retrieve any file that
  242. is either hidden or a system file or both.   You  can  specify  "/ATTR=ALL"  to
  243. specify that all files are to be processed.  Initially defaults to /ATTR=-H-S-R
  244. (skip hidden, system, or read-only files).
  245.  
  246. "/F" says to create a report file named C:\DIRCOMP.TXT which shows what  action
  247. was taken.  "/F" is, in fact, the same  as  entering  "/FC:\DIRCOMP.TXT".   The
  248. default is initially to create no report at all ("/-F").
  249.  
  250. "/Frptfile" provides the  name  of  the  report  file  to  create.   Specifying
  251. "/FSCRN:" will send the report to the screen.   The  default  is  initially  to
  252. create no report at all ("/-F").
  253.  
  254. "/-F" skips the creation of the report file.  This is initially the default.
  255.  
  256. "/OVERWRITE" says to overwrite the report file if it's already there.
  257.  
  258. "/APPEND" says to append to the end of any existing report file.
  259.  
  260. "/-OVERWRITE" says to abort if the output file exists already.
  261.  
  262. "/OVERASK" says to prompt if the output  file  exists  already.   This  is  the
  263. default.
  264.  
  265.  
  266. DIRCOMP.DOC                            6                           Jul 31, 1997
  267.  
  268. "/ALL" says to write all files to the report file  (typically  C:\DIRCOMP.TXT),
  269. not just the ones that have differences.  "/-ALL" (the opposite)  is  initially
  270. the default.
  271.  
  272. "/Tpath" specifies where to write the temporary ISAM  files  that  the  routine
  273. needs.  ISAM data bases are used to store and sort the file names.  ISAM  files
  274. cannot be created reliably on certain types of drives.  Examples are "/TC:" and
  275. "/TC:\TEMP".  If  not  specified,  the  routine  writes  to  the  following  in
  276. sequence:
  277.  
  278.   - the value of any TEMP, then TMP, environmental variable
  279.   - C:\TEMP
  280.   - C:\
  281.  
  282. "/Q" turns off the file-by-file status messages.  It also turns off a  detailed
  283. summary table that shows up after the program is finished.
  284.  
  285. "/COLOR=nnn" specifies the default color settings to  use.   The  setting  must
  286. must consist of three digits, the first two being the foreground color and  the
  287. last being the background color.  The foreground color should be padded on  the
  288. left with a 0 if it is only one  digit  in  length.   Defaults  to  "COLOR=071"
  289. (white on blue).
  290.  
  291. Foreground colors:
  292.  
  293.         Low intensity           High intensity
  294.  
  295.         0 = black                8 = dark grey
  296.         1 = blue                 9 = light blue
  297.         2 = green               10 = light green
  298.         3 = cyan                11 = light cyan
  299.         4 = red                 12 = light red
  300.         5 = magenta             13 = light magenta
  301.         6 = brown (or yellow)   14 = light yellow
  302.         7 = white               15 = bright white
  303.  
  304. Adding 16 to any color will make the text blink.  Background colors can consist
  305. of 0 to 7 above.  Bright white on blue, for example, would be "151".  Note that
  306. the program automatically adds 8 to the settings periodically for  emphasis  so
  307. setting the  default  color  to  be  high  intensity  will  actually  make  the
  308. deliberately highlighted text  blink.   Very  few  sane  people  actually  like
  309. blinking text so using foreground colors above 7 is not recommended.
  310.  
  311. "/MONO" (or "/-COLOR") turns off the colors.  Same thing as "/COLOR=070".
  312.  
  313. "/Iinitfile" says to read an initialization file with the file name "initfile".
  314. The file specification *must* contain a period.  Initfiles are described in the
  315. BRUCEINI.DOC file.  Initially defaults to "/IDIRCOMP.INI".
  316.  
  317. "/-I" (or "/INULL") says to skip loading the initialization file.
  318.  
  319.  
  320. DIRCOMP.DOC                            7                           Jul 31, 1997
  321.  
  322. "/ENV" says to look for %var% occurrences  in  the  command  line  and  try  to
  323. resolve any apparent environmental variable references.  See  BRUCEINI.DOC  for
  324. more information.  This is initially the default.
  325.  
  326. "/-ENV" says to skip resolving apparent %var% occurrences in the command  line.
  327. Initially defaults to "/ENV".
  328.  
  329. "/?" or "/HELP" or "HELP" shows you the syntax for the command.
  330.  
  331. Samples:  DIRCOMP J:\EBBNEW\DATA E:\EBBNEW\DATA /DIFF /KILL /FC:\DATA.EBB
  332.           DIRCOMP E:\EBBNEW\DATA J:\EBBNEW\DATA /A /KILL
  333.           DIRCOMP C:\TC D:\TEMP /CLONE /KILL /ATTR=ALL /S
  334.  
  335.  
  336. Return codes:
  337.  
  338. DIRCOMP returns the following ERRORLEVEL codes:
  339.  
  340.         0 = no problems
  341.       249 = /NONE not specified but nothing copied/moved/deleted
  342.       250 = operation aborted by pressing Escape
  343.       251 = other problems
  344.       253 = no files found in subdirectories
  345.       254 = could not find a decent temporary output subdirectory
  346.       255 = syntax problems, or /? requested
  347.  
  348.  
  349. Author:
  350.  
  351. This program was written by Bruce Guthrie of Wayne Software.  It  is  free  for
  352. use and  redistribution  provided  relevant  documentation  is  kept  with  the
  353. program, no changes are made to the program or documentation,  and  it  is  not
  354. bundled with commercial programs or charged for separately.  People who need to
  355. bundle it in for-sale packages must  pay  a  $50  registration  fee  to  "Wayne
  356. Software" at the following address.
  357.  
  358. Additional information about this and other  Wayne  Software  programs  can  be
  359. found in the file BRUCE.DOC which should be included in the original ZIP  file.
  360. The recent change history for this and the other programs is  provided  in  the
  361. HISTORY.ymm file which should be in the same ZIP file where "y" is replaced  by
  362. the last digit of the year and "mm" is the two  digit  month  of  the  release;
  363. HISTORY.611 came out in November 1996.  This same naming convention is used  in
  364. naming the ZIP file (DIRCOymm.ZIP) that this program was included in.
  365.  
  366. Comments and suggestions can also be sent to:
  367.  
  368.                 Bruce Guthrie
  369.                 Wayne Software
  370.                 113 Sheffield St.
  371.                 Silver Spring, MD 20910
  372.  
  373.                 e-mail: WayneSof@erols.com   fax: (301) 588-8986
  374.                 http://www.geocities.com/SiliconValley/Lakes/2414
  375.  
  376. Please provide an Internet e-mail address on all correspondence.
  377. 
  378.